from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():
    # Declare launch arguments
    use_sim_time_arg = DeclareLaunchArgument(
        'use_sim_time',
        default_value='true',
        description='Use simulation time'
    )
    
    vehicle_model_arg = DeclareLaunchArgument(
        'vehicle_model',
        default_value='sample_vehicle',
        description='Vehicle model name'
    )

    # Currently, we only start the terminal server as a demo
    # The planning nodes will be added when they have proper executables
    terminal_server_node = Node(
        package='tools',
        executable='terminal_server.py',
        name='terminal_server',
        parameters=[{
            'use_sim_time': LaunchConfiguration('use_sim_time')
        }],
        output='screen'
    )

    return LaunchDescription([
        use_sim_time_arg,
        vehicle_model_arg,
        terminal_server_node,
    ])